package com.v2.k10;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

import javax.annotation.Resource;

@ComponentScan("com.v2.k10")
public class AppConfig {


	//1. 根据名字注入
//	@Resource(name="k1")
//	public User user1;
//
//	@Bean("k1")
//	public User getUser() {
//		return new User("kzx");
//	}

	//2.根据类型注入
	@Resource
	public User user1;

	@Bean
	public User getUser() {
		return new User("kzx");
	}

}
